home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Night Owl 6
/
Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso
/
038a
/
bas_int1.zip
/
SCROLL.BAS
< prev
next >
Wrap
BASIC Source File
|
1991-02-02
|
4KB
|
111 lines
'=================================================================
'***** Screen Scrolling with Call Interrupt
'To demonstrate the use of interrupt 10H ah=06
'To scroll any part of the screen up or down
'QB must be invoked with the /l switch. In QB.BI the RegType is
'defined and the INTERRUPT-Call set up.
'By Johan Lindgren (BBS:+46 60115371)
'=================================================================
DECLARE SUB scroll.ner (rader!, left!, up!, right!, down!)
DECLARE SUB scroll.up (rader!, left!, up!, right!, down!)
'$INCLUDE: 'QB.BI'
DIM SHARED inregs AS RegType, outregs AS RegType
'---------------------------------------------------------------------
' Fill the screen with numbers to indicate where scrolling takes place
'---------------------------------------------------------------------
FOR i = 1 TO 24
FOR j = 1 TO 40
PRINT USING "##"; i;
NEXT j
NEXT i
'----------------------------------------------------------
' Do one scroll up first. Give values and call the sub
'----------------------------------------------------------
rader = 5: up = 5: left = 19: down = 14: right = 21
scroll.up rader, left, up, right, down
'------------------------------------------------------------
' Do a scroll down. Give values and call the sub
'------------------------------------------------------------
rader = 3: up = 11: left = 35: down = 20: right = 70
scroll.ner rader, left, up, right, down
'END of demo.
END
'=======================================================================
'SUB Scroll.ner(rader,left,up,right,down)
'Purpose: To scroll characters on video screen down
'Useage: rader = #rows to scroll down
' left = #columns between left border & scrolling block
' up = eg, up=n => (n+1)st row scrolled down, and all
' rows below will scroll except for protected area
' defined by "down"
' right = eg, right=n => Column (n+1) is right most column
' of scrolling block to scroll
' down = eg, down=n => (25-n-1) bottom rows protected & not
' scrolled over.
'=======================================================================
SUB scroll.ner (rader, left, up, right, down)
'-----------------------------------------------------------
'First put up and down in right hexadecimal postion
'Then enter the values into the registers and call interrupt
'------------------------------------------------------------
up = up * 256
down = down * 256
inregs.ax = &H700 + rader
inregs.cx = up + left
inregs.dx = down + right
CALL INTERRUPT(16, inregs, outregs)
END SUB
'=======================================================================
'Purpose: to scroll characters up on CRT
'Useage: Scroll.up rader,left,up,right,down
' where rader = #rows to move up
' right = right most column of scrolling block to scroll + 1;
' eg, right=20 => 21st column will scroll but not 22nd
' left = # of columns to left of scrolling block that will
' not scroll.
' up = eg, up=n => top n rows are protected and not
' scrolled over.
' down = eg, down=n => scroll the (n+1)st row up "rader" times
' All rows above the (n+1)st row will also scroll up
' except for "up" rows.
'=========================================================================
SUB scroll.up (rader, left, up, right, down)
'-----------------------------------------------------------
'First put up and down in right hexadecimal postion
'Then enter the values into the registers and call interrupt
'------------------------------------------------------------
up = up * 256
down = down * 256
inregs.ax = &H600 + rader
inregs.cx = up + left
inregs.dx = down + right
CALL INTERRUPT(16, inregs, outregs)
END SUB